home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
bmp_db
/
bmp_db.bas
next >
Wrap
BASIC Source File
|
1995-10-23
|
1KB
|
52 lines
Sub PicDB_Add (Filename As String, Bitmapname As String, Caption As String, PicBox As Control)
'Procces data
X = FreeFile
Open Filename For Binary As #X
If LOF(1) = 0 Then GoTo npos
Get #X, 1, NOR%
npos:
NOR% = NOR% + 1
Put #X, 1, NOR%
R = LOF(X) + 1
E% = Len(Caption)
Put #X, R, E%
Put #X, , Caption
Y = FreeFile
Open Bitmapname For Binary As #Y
O& = LOF(Y)
Put #X, , O&
L$ = String$(O&, " ")
Get #Y, , L$
Put #X, , L$
Close #Y
Close #X
End Sub
Sub PICDB_Load (Filename As String, Recnum As Integer, Caption As String, Pic As Control)
X = FreeFile
Open Filename For Binary As #X
Get #X, 1, E%
For I = 1 To (Recnum - 1)
Get #X, , E%
R$ = String$(E%, " ")
Get #X, , R$
Get #X, , O&
R$ = String$(O&, " ")
Get #X, , R$
Next
Get #X, , E%
Caption = String$(E%, " ")
Get #X, , Caption
Get #X, , O&
R$ = String$(O&, " ")
Get #X, , R$
Y = FreeFile
Open "BMPDB.TMP" For Output As #Y
Print #Y, R$
Close #Y
Close #X
Pic.Picture = LoadPicture("BMPDB.TMP")
Kill "BMPDB.tmp"
End Sub